﻿<%@ Register TagPrefix="cc1" Namespace="Mysoft.PubProject.Business" Assembly="Mysoft.PubProject.Business" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Khfp_CxfpKh.aspx.vb" Inherits="Slxt.Khfp_CxfpKh"%>
<%@ Register TagPrefix="cnt" Namespace="Mysoft.Map.Application.Controls" Assembly="Mysoft.Map.Application.Components" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>分配新客户</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1" />
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1" />
		<meta name="vs_defaultClientScript" content="JavaScript" />
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
		<script language="javascript" type="text/javascript" src="/_controls/settings.aspx"></script>
		<link rel="stylesheet" type="text/css" href="/_grid/map_grid.css" />
		<link rel="stylesheet" type="text/css" href="/_common/styles/global.css" />
		<link rel="stylesheet" type="text/css" href="/_nav/taskbox.css" />
		<link rel="stylesheet" type="text/css" href="/_nav/menu.css" />
		<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css" />
		<link rel="stylesheet" type="text/css" href="/_controls/find/find.css" />
		<!-- select -->
		<link rel="stylesheet" type="text/css"  href="/MyWorkflow/css/form.css" />
		<script language="javascript" type="text/javascript" src="/_common/scripts/global.js"></script>
		<script language="javascript" type="text/javascript" src="/_controls/find/find.js"></script>
		<script language="javascript" type="text/javascript" src="/_controls/util/util.js"></script>
		<script language="javascript" type="text/javascript" src="/_controls/datetime/date.js"></script>
		<script language="javascript" type="text/javascript" src="/_controls/number/number.js"></script>
		<!-- DropDownTree -->
		<link rel="stylesheet" type="text/css" href="/_controls/tree/dropdowntree.css" />
		<link rel="stylesheet" type="text/css" href="/pubproject/_controls/CRMControls/ProjDDTree.css" />
		<script language="javascript" type="text/javascript" src="/slxt/js/Public.js"></script>
		<script language="javascript" src="/_controls/lookup/selectteamuser.js"></script>

		
		<script language="javascript" type="text/javascript">
	    //在线帮助文件
	    var _MyHelpfile = "";

	    function window.onload() {
	        doQuery();
	    }
        
        // 查询事件
	    function doQuery(isQuery) { 
	        if (!isQuery && appProjTree.value !== appProjTree.ovalue) {
	            //重新过滤置业顾问
	            InitZygw();
	        }
	        //校验条件
	        if (!vaildeFilter()) { return; }
	        // 设置URL和参数
	        var strUrl = appIframe.frameElement.url + "?";
	        var aryParams = [];
	        aryParams.push("funcid=" + __funcid.value);
	        aryParams.push("ProjGUID=" + appProjTree.value);
	        aryParams.push("BgnLastDate=" + escape(document.getElementById("txtBgnLastDate").value));
	        aryParams.push("EndLastDate=" + escape(document.getElementById("txtEndLastDate").value));
	        aryParams.push("Zygw=" + escape(document.getElementById("cboZygw").returnValue));
	        aryParams.push("LastLxDate=" + escape(document.getElementById("cboLastLxDate").returnValue));
	        aryParams.push("Yqwgj=" + (document.getElementById("chkYqwgj").checked ? "1" : "0"));
	        aryParams.push("CstName=" + escape(document.getElementById("txtCstName").value));
	        aryParams.push("Lxdh=" + escape(document.getElementById("txtLxdh").value));

	        // 连接
	        appIframe.location = strUrl + aryParams.join("&");
	        appProjTree.ovalue = appProjTree.value;
	    }
        
        // 校验查询数据
	    function vaildeFilter() {
	        var strBgnLastDate = document.getElementById("txtBgnLastDate").value;
	        var strEndLastDate = document.getElementById("txtEndLastDate").value;
	        if (strBgnLastDate != "" && strEndLastDate != "") {
	            if (strEndLastDate < strBgnLastDate) {
	                alert("截止日期要大于等于起始日期！");
	                return false;
	            }
	        }
	        return true;
	    }

	    //根据项目不同加载相应的置业顾问
	    function InitZygw() {

	        var sUserGUID = document.getElementById("hidUserGUID").value;
	        var sProjGUID = appProjTree.value;
	        var sPath = "/Slxt/XSZDH/Yqywcb_Pub_XMLHTTP.aspx?UserGUID=" + sUserGUID + "&ProjGUID=" + sProjGUID;
	        var strRtn = openXMLHTTP(sPath, "BuildZYGW");
	        document.getElementById("_Preferred_Table").outerHTML = strRtn;
	        document.getElementById("cboZygw").setValue("all");
	    }
		</script>
	</head>
	<body MS_POSITIONING="GridLayout" class="tab">
		<cnt:AppLog id="appLog" runat="server" Funcid="01010608"/>
		<table style="FONT-SIZE: 9pt" height="100%" border="0" cellSpacing="0" cellPadding="0" width="100%">
			<tr height="30">
				<td>
					<!--Begin of 下拉列表控件-->
					<table style="width: 100%; table-layout: fixed; height: 30px; vertical-align: text-bottom;"
						cellSpacing="0" cellPadding="1" border="0">
						<colgroup>
						    <col width="50%" />
						    <col width="20" />
						    <col />
						</colgroup>
						<tr >
						    <td>
						        <table width="100%" cellspacing="0" cellpadding="0" width="100%">
                                    <colgroup>
                                        <col width="100" />
                                        <col />
                                    </colgroup>
                                    <tr height="25">
                                        <td><b style="COLOR:#666666">项目</b></td>
							            <td>
								            <form id="Form1" method="post" runat="server" style="DISPLAY:inline">
								            <asp:HiddenField ID="hidUserGUID" runat="server" />
									            <cc1:ProjDDTree2 id="appProjTree" runat="server" DisplayHiberarchy="Project" onquery="doQuery()"
										            IsSelectLastLevelOnly="True" IsSelectAll="False" ProjField="Opp.ProjGUID" ApplySys="销售管理" Width="100%" />
								            </form>
							            </td>
                                    </tr>
                                </table>
						    </td>
						    <td>&nbsp;</td>
						    <td>
						        <table width="100%" cellspacing="0" cellpadding="0" width="100%">
						            <tr>
						                <td width="105">置业顾问</td>
							            <td>
								            <span class="selectBox" style="width:50%" typename="mapType" name="cboZygw" id="cboZygw" value="" runat="server">
								              <table id="_Preferred_Table" cellspacing="0" cellpadding="2" style="display:none;">
									               <tr height="18">
					                                    <td nowrap val="all">--全部--</td>
					                               </tr>					
								             </table>
								            </span>
							            </td>
						            </tr>
						        </table>
						    </td>
						</tr>
						
						<tr>
						    <td>
						        <table width="100%" cellspacing="0" cellpadding="0" width="100%">
                                    <colgroup>
                                        <col width="99" />
                                        <col />
                                        <col width="30" />
                                        <col />
                                    </colgroup>
                                    <tr>
							            <td>最近联系日期&nbsp;从</td>
							            <td>
							                <table width="100%" border="0" cellpadding="1" cellspacing="0" style="table-layout:fixed;" align="left">
							                    <tr>
								                    <td>
									                    <input style="WIDTH:100%" type="text" id="txtBgnLastDate" name="txtBgnLastDate" mapType="dtm" time="0" class="dtm" maxlength="16" value="" returnValue="">
								                    </td>
								                    <td width="37px" align="left">
									                    <img style="CURSOR:hand" align=middle class="dtm" src="/_imgs/btn_off_cal.gif">
								                    </td>
							                    </tr>
						                    </table>
							            </td>
							            <td align="center">到</td>
							            <td>
							                <table width="100%" border="0" cellpadding="1" cellspacing="0" style="table-layout:fixed;" align="left">
							                    <tr>
								                    <td>
									                    <input style="WIDTH:100%" type="text" id="txtEndLastDate" name="txtEndLastDate" mapType="dtm" time="0" class="dtm" maxlength="16" value="" returnValue="">
								                    </td>
								                    <td width="37px" align="left">
									                    <img style="CURSOR:hand" align=middle class="dtm" src="/_imgs/btn_off_cal.gif">
								                    </td>
							                    </tr>
						                    </table>
							            </td>
                                    </tr>
                                 </table>
						    </td>
						    <td>&nbsp;</td>
						    <td>
						        <table width="100%" cellspacing="0" cellpadding="0" width="100%">
                                    <tr>
                                        <td width="105">最后一次联系日期</td>
							            <td>
							                <span id="cboLastLxDate" style="width:50%" class="selectBox" typename="mapType" name="cboLastLxDate" value="">
							                    <table id="_Preferred_Table_1" cellspacing="0" style="display:none;">
							                        <tr height="18" value="all"><td nowrap val="all">--全部--</td></tr>
							                        <tr height="18" value="1"><td nowrap val="1">1~3个月内未联系过</td></tr>
							                        <tr height="18" value="2"><td nowrap val="2">3~6个月内未联系过</td></tr>
							                        <tr height="18" value="3"><td nowrap val="3">半年以上未联系过</td></tr>
							                    </table>
							                </span>
							            </td>
                                    </tr>
						        </table>
						    </td>
						</tr>
						
						<tr>
						    <td>
						         <table width="100%" cellspacing="0" cellpadding="0" width="100%">
						            <colgroup>
						                <col width="100" />
						                <col />
						                <col width="80" />
						                <col />
						            </colgroup>
						            <tr>
						                <td>客户姓名</td>
							            <td>
								            <input style="WIDTH:100%" type="text" id="txtCstName" name="txtCstName" />
							            </td>
							            <td align="center">联系电话</td>
							            <td><input style="WIDTH:100%" type="text" id="txtLxdh" name="txtLxdh" /></td>
						            </tr>
						        </table>
						    </td>
						    <td>&nbsp;</td>
						    <td>
						         <table width="100%" cellspacing="0" cellpadding="0" width="100%">
						            <colgroup>
						                <col width="100"/>
						                <col />
						                <col />
						            </colgroup>
						            <tr>
						                <td>&nbsp;</td>
						                <td><input id="chkYqwgj" name="chkYqwgj" class="checkbox" type="checkbox" /><label for="chkYqwgj">逾期未跟进</label></td>
						                <td style=" text-align:right"><button id="btnSearch" type="button" onclick="doQuery(true)">查 询</button></td>
						            </tr>
						         </table>
						    </td>
						</tr>
					</table>
					<!--End of 下拉列表控件-->
				</td>
			</tr>
			<tr height="10">
				<td></td>
			</tr>
			<tr>
				<td>
					<iframe id="appIframe" url="Khfp_CxfpKh_Grid.aspx" width="100%" height="100%" frameborder="0"
						scrolling="no"></iframe>
				</td>
			</tr>		
		</table>
	</body>
</html>
